<?php $this->page_title = $this->translate ( 'User profile' ).'  -  '.$this->user['username'] ;?>

<div id="main_user" class="span-24 last main">
    <div class="span-18">
        <div class="section_user">
                <h2><?=$this->translate ( 'User profile' ).'  -  '.$this->user['username'];?></h2>
                
                <?php if (isset ( $this->error )) : ?>
                    <div class="error"><h2>
                            <?=$this->escape ( $this->error );?>
                    </h2></div>
                <?php endif;?>
    
    
                <? if (count ( $this->mensajes ) > 0) {
                            echo '<div class="success"><h2>';
                            foreach ( $this->mensajes as $msg ) {
                                echo $msg . '<br>';
                            }
                            echo '</h2></div>';
                        }
                ?>
    
            <div class="user_profile">
            <div class="username"><span class="item_title"><?=$this->translate('User name:');?></span><span class="item_info"><?=$this->user['username'];?></span></div>
            <div class="member_since"><span class="item_title"><?=$this->translate('Member since:');?></span><span class="item_info"><?=$this->escape(date( $this->translate('l dS \o\f F Y H:i:s'), strtotime($this->user['created'])));?></span></div>
    
                 <?php if ($this->friendlist):
                        //var_dump($this->friendlist);
                        echo '<div class="friendlist_icon"><img alt="'.$this->translate('Friends list:').'" src="/images/icons/ico_friend_list.png" class="valign" /><div class="txt_valign">' . $this->translate('Friends list:').'</div></div>';
                 ?>
            
                 <?php
                       foreach ($this->friendlist as $key => $val):
                           echo  '<div class="friendlist"><a class="friend_link" href=" '. '/' . $this->lang . '/profile/' .  $val['username'] . ' ">' . $val['username'] . '</a></div>';
                     ?>
                <?php endforeach; ?>
            
                <?php endif; ?>
           </div>
        </div>    
    </div>
    
    <div class="span-6 last">
        <?=$this->editprofile_tab ?>
        <?=$this->sendmessage_tab ?>
        <?=$this->friend_link ?>
        <div class="user_ads_icon">
         <? if ($this->user['role'] == 2) {  ?>
           <a class="user_ads" id="<?=(preg_match("/listuser/", $_SERVER['REQUEST_URI']))?"tab_active":"lala"?>" href="/<?=$this->lang ?>/ad/listorg/id/<?=$this->user['id'] ?>">
           <img alt="<?=$this->translate('Ads') ?>" src="/images/icons/ico_user_ads.png" class="valign" /><div class="txt_valign"><?=$this->translate('Ads');?></div></a>
        <?php } else { ?>
            <a class="user_ads" id="<?=(preg_match("/listuser/", $_SERVER['REQUEST_URI']))?"tab_active":"lala"?>" href="/<?=$this->lang ?>/ad/listuser/id/<?=$this->user['id'] ?>">
            <img alt="<?=$this->translate('Ads') ?>" src="/images/icons/ico_user_ads.png" class="valign" /><div class="txt_valign"><?=$this->translate('Ads');?></div></a>
        <?php } ?>  
        </div>

        <div class="clearer"></div>
        <div class="advertising">
                        <!-- BEGIN PARTNER PROGRAM - DO NOT CHANGE THE PARAMETERS OF THE HYPERLINK -->
						<script language="javascript" type="text/javascript" src="http://program.epartner.es/view.asp?ref=570686&site=8346&type=html&hnb=5&js=1"></script>
						<noscript><a href="http://web.epartner.es/click.asp?ref=570686&site=8346&type=b1&bnb=1" target="_blank">
						<img src="http://program.epartner.es/view.asp?ref=570686&site=8346&b=1" border="0"/></a><br /></noscript>
						<!-- END PARTNER PROGRAM -->

        </div>
    </div>
</div> <!-- /main -->      

